package com.walking.service2;

import com.walking.dao.UserDAO;
import com.walking.ds.DataSource;
import com.walking.util.UserUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@DataSource("second")
public class UserServiceV2 {
    @Autowired
    private UserDAO userDAO;

    /**
     * 方法上未指定数据源，类上指定
     */
    public void save_1() {
        userDAO.save(UserUtil.createUser());
    }

    public void save_2() {
        userDAO.save(UserUtil.createUser());
    }
}
